package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.BgUserService;
import com.ai.web.vo.BgUserV;
import com.ai.web.vo.ResultModel;
import com.tiny.persistence.domain.BgUser;
import com.tiny.persistence.repository.BgUserRepo;
/**
 * 后台用户
* @ClassName: BgBgUserServiceImpl 
* @Description: TODO 
* @author:  
* @date: 2014年3月28日
*
 */
@Service
public class BgUserServiceImpl extends BaseServiceImpl<BgUser, Integer, BgUserV> implements BgUserService  {

	@Autowired
	private BgUserRepo bgBgUserRepo;
	
	@Autowired
	public BgUserServiceImpl(BgUserRepo bgUserRepo) {
		super(bgUserRepo);
	}

	public BgUserV getBgUser(int userId) throws Exception {
		return getT(userId);
	}

	public ResultModel saveBgUser(BgUserV BgUserV) throws Exception {
		
		BgUserV saveV = saveT(BgUserV);
		
		ResultModel rm = new ResultModel();
		rm.setData(saveV);
		rm.setSuccessCode();
		
		return rm;
	}

	public ResultModel deleteBgUsers(List<Integer> userIds) throws Exception {
		deleteTs(userIds);
		
		ResultModel rm = new ResultModel();
		rm.setSuccessCode();
		rm.setMsg("删除成功！");
		
		return rm;
	}
}
